import {CFormGroupProps} from "@/components/CProForm/CFormItem/type";

// @ts-ignore
const fields: CFormGroupProps<any>[] =  ({edit}: {edit: boolean}) => {
  return [
    {
      itemList: [
        {
          name: "name",
          label: "字典名称",
          labelAlign:"right",
          disabled: edit,
          rules: [
            {
              message: "字典名称是必填项",
              required: true
            }
          ],
          width: "md",
          placeholder: "输入字典名称",

        }
      ]
    },
    {
      itemList: [
        {
          name: "desc",
          label: "字典描述",
          labelAlign:"right",
          rules: [
            {
              message: "字典描述是必填项",
              required: true
            }
          ],
          width: "md",
          placeholder: "输入字典描述",
        }
      ]
    },
    {
      itemList: [
        {
          name: "enum_",
          label: "是否枚举",
          labelAlign:"right",
          initialValue: false,
          rules: [
            {
              required: true
            }
          ],
          width: "md",
          type: "switch",
          disabled: edit
        },
      ]
    }
  ]
}

export default fields;
